<template>
	<div class="footer">
		<div class="paersonal-footer-button">
			<van-button round type="success">修改信息</van-button>
			<van-button round type="success" color="red" @click="logout"
				>退出登录</van-button
			>
		</div>
	</div>
</template>
<script setup>
import { useRouter } from "vue-router"
import { showNotify } from "vant"

import { usePhongStore } from "../stores/phone-store"

const PhongStore = usePhongStore()
const router = useRouter()

const logout = () => {
	// 退出登录
	localStorage.removeItem("token")
	localStorage.removeItem("userid")

	PhongStore.setUserid("")
	showNotify({ type: "primary", message: "退出成功" })

	router.push("/login")
}
</script>

<style scoped>
.footer {
	background-color: #eee;
	width: 100%;
	padding-bottom: 18px;
}
.paersonal-footer-button button {
	margin: 0 20px;
}
</style>
